<include file="__THEME__/header" />
<div class="content no_bg2"><!-- 内容 begin  --> 
  <include file="__THEME__/shop_menu" />
  <!--<link href="__PUBLIC__/js/jqzoom/jquery.jqzoom.css" rel="stylesheet" type="text/css" />
  <script type="text/javascript" src="__PUBLIC__/js/jqzoom/jquery.jqzoom.js"></script>-->
  <script type="text/javascript">
    $(function($){
	  // $(function() {
	      //$('#jqzoom').jqzoom({zoomWidth: 300,zoomHeight: 220,xOffset: 20,});
       //});
	})
  </script>
  <div class="shop_right">
    <div class="mainbox">
      <div class="mainbox_C no_r">
          
          <div class="add_app">
           <h1>{$goods['title']}</h1>
          <div class="add_app_box">
          <div class="left">
           <div class="goods_img_box">
              <php>if($goods['gimage']){</php><a href="__UPLOAD__/goods/{$goods['gimage']}" id="jqzoom" target="_blank"><img src="__UPLOAD__/goods/m_{$goods['gimage']}"  alt="点击看大图" title="点击看大图"/></a><php>}else{</php>
              <a href="__THEME__/images/no_image_b.gif" target="_blank"><img src="__THEME__/images/no_image_m.gif" alt="点击看大图" title="点击看大图"/> </a>
            <php>}</php>
            </div>
			<!-- Baidu Button BEGIN -->
            <div id="bdshare" class="bdshare_t bds_tools get-codes-bdshare">
            <span class="bds_more">分享到：</span>
            <a class="bds_qzone"></a>
			<a class="bds_tsina"></a>
			<a class="bds_tqq"></a>
			<a class="bds_renren"></a>
			<a class="shareCount"></a>
			</div>
			<script type="text/javascript" id="bdshare_js" data="type=tools&amp;mini=1" ></script>
			<script type="text/javascript" id="bdshell_js"></script>
			<script type="text/javascript">
			document.getElementById("bdshell_js").src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + new Date().getHours();
			</script>
<!-- Baidu Button END -->
            </div>
            <div class="add_app_li">
            <ul>
              
                
	                <li>  <php>if($uid==$mid){</php> 
               <h3 class="right"> <a href="{:U('home/Myshop/edit',array('id'=>$goods['id']))}" target="_blank">编辑</a></h3>
              <php>}</php> <span>商品名称：</span>{$goods['gname']}</li>
                    <li><span>价格：</span><em>￥{$goods['gprice']}</em></li>
                    <li><span>数量：</span> <em>{$goods['gnumber']}</em></li>
                    <li><span>商品所在地区：</span>{$goods['location']}</li>
                    <li><span>商品所在学校：</span>{$goods['school']}</li>
                   
                    <li><span>创建时间：</span>{$goods['ctime']|friendlyDate}</li>
                    <li><span>最后修改：</span>{$goods['utime']|friendlyDate}</li>
                    <li><span>浏览次数：</span>{$goods['gscan']}次</li>
                
            </ul>
            </div>
			<div class="add_pay_li">
            <ul>
	                <li> <a href="http://www.alipay.com" target="_blank"><img src="__PUBLIC__/themes/classic/images/zhifubao2.jpg" /></a> </li>
                    <li> <a href="http://www.tenpay.com" target="_blank"><img src="__PUBLIC__/themes/classic/images/caifutong2.jpg" /></a> </li>
                    <li> <a href="http://www.99bill.com" target="_blank"><img src="__PUBLIC__/themes/classic/images/kuaiqian2.jpg" /></a> </li>
                
            </ul>
            </div>
           </div>
           <div class="xq-menu">
           <ul><li>
           商品详细信息</li>
           </ul></div>
         <div class="xq_details">{$goods['gdetails']}</div>
         <div class="xq-menu">
           <ul><li>
           留言评论</li>
           </ul></div>
           <php>if($mid){</php>
         <div class="message"> 
         <form action="{:U('shop/index/add_Lw_gd')}" method="post">
         <input name="goods_id" value="{$goods['id']}" type="hidden" id="goods_id"/>
         <textarea name="message" style="width: 98%;" rows="3"cols="" class="message_text text" id="shop_Lw"></textarea>
         
         <input type="button" name="savelw" id="savelw"  value="发表留言" class="N_but right" onclick="doAddLw();"/>
         </form>
         </div>
         <php>}</php>
         <div id="lw_list">
         <php>if($lwlist){</php>
         <volist name="lwlist" id="vo">
         <div class="message" id="lw_{$vo['id']}"> 
       <ul>
        <li>
        <em><php>if($uid==$mid || $vo['from_uid']==$mid){</php><a href="javascript:void(0);"  onclick="ui.confirm(this,'确认要删除这条留言?')" callback="Del({$vo['id']});">删除</a><php>}</php> {$vo['ctime']|friendlyDate}</em>
         <space uid="vo.from_uid">{uavatar=s}</space>
          {$vo['from_uname']}:  </li>
          <p class="message_text">{$vo['message']}</p>
        </ul>
          </div>
          </volist>
          <php>}else{</php>
          <br/>
          无留言信息
          <php>}</php>
        </div>
        <div class="page">{$page}</div>
         
        </div>
        </div>
    </div>
  </div>
  <div class="c"></div>
</div>
<script>

function doAddLw(){
	var content = $("#shop_Lw").val();
	var goods_id = $("#goods_id").val();	
	if($.trim(content) ==''){
		ui.error('留言内容不能为空');
		return false;
	}else if(content.length >100){
		ui.error('留言内容不能超过100字');
		return false;
	}
	$.post(U('shop/Index/add_Lw_gd'),{goods_id:goods_id,touid:_UID_,message:content},function(rel){
		if(rel==0){
			ui.error('留言失败');	
		}else{
		 var mid = "{$mid}";
		 var html = '';
            html += '<div class="message" id="lw_'+rel+'"><ul><li>';
			html += '<em><php>if($uid==$mid){</php><a href="javascript:void(0);" onclick="Del('+rel+');">删除</a><php>}</php> 刚刚</em>';
            html += "<space uid="mid">{uavatar=s}</space>";
			html += ' 我:  </li>';
            html += '<p class="message_text">'+content+'</p>';
           
            html += ' </ul> </div>';
            $("#lw_list").prepend(html);
        $("#shop_Lw").val('');
		ui.success('留言成功');
		ui.box.close();			
		}
		});
 }
function Del (lw_id) {
	
	$.post(U('shop/Index/Del_lw'),{lw_id:lw_id},function(rel){
		
		if(rel == 1){
			$('#lw_'+lw_id).remove();
			ui.success('删除成功');
			ui.box.close();
			}else{
			ui.error('删除失败');	
		}
	  });
		
	}
</script>
<include file="__THEME__/footer" /> 